<template>
  <div>
    <div class="activities" @click="sms()">
      <div class="notice">活动通知</div>
      <div class="concer">根據指定的活動，向報名活動的會員發送通知郵件。</div>
      <div class="pic"></div>
    </div>
    <div class="activities" @click="person_sms()">
      <div class="notice">會員通知</div>
      <div class="concer">自定義郵件内容，將郵件發送給指定的會員。</div>
      <div class="pic"></div>
    </div>
  </div>
</template>

<script>
import { isManager } from '@/api/society'
import { isLogin } from '@/api/login'
export default {
  name: 'EmailServer',
  data () {
    return {
      sid: this.$route.query.sid
    }
  },
  created () {
    this.isManager()
    this.isLogin()
  },
  methods: {
    isLogin () {
      isLogin().then(res => {
        if (res.code === 0) {
          alert('请先登录')
          this.$router.push('/login')
        }
      })
    },
    sms () {
      this.$router.push('/activity_list?sid=' + this.sid + '#email_activity')
    },
    person_sms () {
      this.$router.push('/person_check?sid=' + this.sid + '#email')
    },
    isManager () {
      isManager({
        sid: this.sid
      }).then(res => {
        if (res.code !== 1) {
          this.$router.go(-1)
        }
      }).catch(err => {
        console.log(err)
      })
    }
  }
}
</script>

<style type="text/css" scoped>
* {
  margin: 0;
  padding: 0;
}

body {
  font-family: PingFangSC;
}

.activities {
  height: 80px;
  margin: 20px auto auto auto;
  background: rgb(255, 255, 255);
}

.notice {
  line-height: 50px;
  font-weight: 500;
  margin: 0px auto auto 15px;
  font-size: 20px;
}

.concer {
  margin: -10px auto auto 15px;
  font-size: 14px;
  color: gray;
}

.pic {
  background-image: url(../style/img/sign.png);
  width: 7px;
  height: 14px;
  background-size: 100% 100%;
  float: right;
  margin: -26px 19px 10px;
}
</style>
